Endpoint
POST https://api.portix.ai/v1/messages
This free route accepts Anthropic Messages requests and routes only to Anthropic-compatible platforms. To keep the Anthropic format while calling OpenAI or Gemini models, use the Anthropic Format Converter.
Install SDKs
- Python
- Node.js
- Go
pip install anthropic
npm install @anthropic-ai/sdk
go get github.com/anthropics/anthropic-sdk-go
Code Examples
- cURL
- Python
- Node.js
- Go
curl https://api.portix.ai/v1/messages \
-H "Content-Type: application/json" \
-H "x-api-key: $YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-d @- << 'EOF'
{
"model": "claude-sonnet-4-5-20250929",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Why is the sky blue?"}
]
}
EOF
import os
import anthropic
client = anthropic.Anthropic(
api_key=os.getenv('YOUR_API_KEY'),
base_url='https://api.portix.ai'
)
message = client.messages.create(
model='claude-sonnet-4-5-20250929',
max_tokens=1024,
messages=[
{'role': 'user', 'content': 'Why is the sky blue?'}
]
)
print(message.content[0].text)
import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic({
apiKey: process.env.YOUR_API_KEY,
baseURL: 'https://api.portix.ai'
});
const message = await client.messages.create({
model: 'claude-sonnet-4-5-20250929',
max_tokens: 1024,
messages: [
{ role: 'user', content: 'Why is the sky blue?' }
]
});
console.log(message.content[0].text);
package main
import (
"context"
"os"
"github.com/anthropics/anthropic-sdk-go"
"github.com/anthropics/anthropic-sdk-go/option"
)
func main() {
client := anthropic.NewClient(
option.WithAPIKey(os.Getenv("YOUR_API_KEY")),
option.WithBaseURL("https://api.portix.ai"),
)
message, _ := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
Model: anthropic.F("claude-sonnet-4-5-20250929"),
MaxTokens: anthropic.Int(1024),
Messages: anthropic.F([]anthropic.MessageParam{
anthropic.NewUserMessage(anthropic.NewTextBlock("Why is the sky blue?")),
}),
})
}
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID (e.g., claude-sonnet-4-5-20250929) |
messages | array | Yes | Array of message objects |
max_tokens | integer | Yes | Maximum tokens to generate |
temperature | number | No | Sampling temperature (0-1) |
stream | boolean | No | Enable streaming response |
Response Format
{
"id": "msg_xxx",
"type": "message",
"role": "assistant",
"content": [
{"type": "text", "text": "The sky appears blue because..."}
],
"model": "claude-sonnet-4-5-20250929",
"stop_reason": "end_turn",
"usage": {
"input_tokens": 10,
"output_tokens": 50
}
}